using System.Windows;
using Microsoft.Practices.Unity;
using PrismNavigationFramework.Infrastructure;
using PrismNavigationFramework.MVVM;
using PrismNavigationFramework.Navigation;

namespace PrismNavigationFramework
{
    public class Bootstrapper
    {
        public static void Initialize(IUnityContainer container)
        {
            container.RegisterType<IPrismNavigationConfiguration, PrismNavigationConfiguration>(new ContainerControlledLifetimeManager());
            container.RegisterType<IViewToUrlMappingRegistrationService, ViewToUrlMappingRegistrationService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IViewInitializationService, ViewInitializationService>(new ContainerControlledLifetimeManager());
           
            container.RegisterType<IPrismViewLoadingService, PrismViewLoadingService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IViewNavigationContextInformationParsingService, ViewNavigationContextInformationParsingService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IViewInitializationDataParsingService, UrlViewInitializationDataParsingService>(new ContainerControlledLifetimeManager());
            container.RegisterType<ILoadedModulesRegistrationService, LoadedModulesRegistrationService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IPrismModuleLoadingService, PrismModuleLoadingService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IModuleNamesRegistrationService, ModuleNamesRegistrationService>(new ContainerControlledLifetimeManager());
            container.RegisterType<IViewRegistrationService, ViewRegistrationService>(new ContainerControlledLifetimeManager());

            container.RegisterType<IKeyValuePairsParsingService, SeparatedKeyValuePairsParsingService>();            
          
            container.RegisterType<IViewCreationService, ViewCreationService>();
        }
    }
}